﻿
@{
    ViewBag.Title = "检查某个字段是否有空值  ";
    Layout = null;
}

<script src="~/Scripts/jquery-1.10.2.min.js"></script>
<div>数据库连接字符 <input style="width:100%" id="txtFkSqlConn" value="server=10.5.11.218\sql2012;database=dotnet_erpV20_SL_HN;uid=sa;pwd=95938;" /></div>
<div><button onclick="jiaoyan(this)">检查</button></div>
<textarea id="FkbNoData" style="width:100%"></textarea>
<script>
    function jiaoyan(obj) {
         var $obj = $(obj);
        $obj.attr("disabled", "disabled");
        $.ajax({
            url: "@Url.Action("CheckFieldAction")",
            data: "sqlconn=" + $("#txtFkSqlConn").val().trim() + "&filed=BUGUID",
            dataType:"json",
            success: function (resultList) {
                var result = "";
                for (var i = 0; i < resultList.length; i++) {
                    result += resultList[i] + "、";
                }
                $("#FkbNoData").val(result);
            },
            error: function (a, b, c) {
                alert("检查失败" + a.responseText);
            },
            complete: function () {
                $obj.removeAttr("disabled");
            }
        });
    }
</script>